package com.kaili.basic.pojo.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.kaili.common.pojo.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Objects;

/**
 * @Desc:   告警Entity
 * @author: jianfeng
 * @Time: 2019/8/2 14:23
 * @Copyright: © 2018 杭州凯立通信有限公司 版权所有
 * @Warning: 本内容仅限于公司内部传阅, 禁止外泄或用于其它商业目的
 */
@Data
@ApiModel(description = "告警表")
@TableName("mdm_alarm")
@NoArgsConstructor
public class MdmAlarmEntity extends BaseEntity {

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), alarmSetId);
    }

    @ApiModelProperty("主键id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @NotNull
    @ApiModelProperty("设备id")
    private Integer deviceId;

    @ApiModelProperty("告警内容")
    private String content;

    @ApiModelProperty("告警项id")
    private Integer alarmSetId;

    @ApiModelProperty("告警关闭时间")
    private Date closeTime;

    @ApiModelProperty("数据状态：0删除，1正常")
    private String rdStatus;

    @ApiModelProperty("是否发送邮件：0未发送，1已发送")
    private String isEmail;

    @ApiModelProperty("是否发送短信：0未发送，1已发送")
    private String isPhone;

    public MdmAlarmEntity(Integer deviceId, String content, Integer alarmSetId, String rdStatus, Integer createBy, Date createTime) {
        this.deviceId = deviceId;
        this.content = content;
        this.alarmSetId = alarmSetId;
        this.rdStatus = rdStatus;
        super.createBy = createBy;
        super.createTime = createTime;
    }

    public MdmAlarmEntity(Integer id, Date closeTime, Integer modifyBy, Date modifyTime) {
        this.id = id;
        this.closeTime = closeTime;
        super.modifyBy = modifyBy;
        super.modifyTime = modifyTime;
    }

    public MdmAlarmEntity(Integer alarmSetId) {
        this.alarmSetId = alarmSetId;
    }

}
